#!/bin/bash

sleep 300
while true
do 
	procnum='ps | grep tcrwork/ | grep -v grep |wc -l'
	if [ $procnum -eq 0 ]; then
		echo $(date):HMI_NotFound >> /tcrwork/log.txt
		sleep 30
		if [ $procnum -eq 0 ]; then
			echo $(date):HMI_Error >> /tcrwork/log.txt
			sh /tcrwork/linuxControllerHmi/trunk/tool/tcrwork/linuxControllerHmi/trunk/hmiController/bin/hmi.sh
		fi
	fi
	sleep 30
done
